package net.wds.ssbus.modules.dbconfig.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import net.wds.ssbus.common.utils.PageUtils;
import net.wds.ssbus.common.utils.Query;
import net.wds.ssbus.modules.dbconfig.dao.TbDbSourceConfigDao;
import net.wds.ssbus.modules.dbconfig.entity.TbDbSourceConfigEntity;
import net.wds.ssbus.modules.dbconfig.service.TbDbSourceConfigService;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;



@Service("tbDbSourceConfigService")
public class TbDbSourceConfigServiceImpl extends ServiceImpl<TbDbSourceConfigDao, TbDbSourceConfigEntity> implements TbDbSourceConfigService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<TbDbSourceConfigEntity> page = this.page(
                new Query<TbDbSourceConfigEntity>().getPage(params),
                new QueryWrapper<TbDbSourceConfigEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public TbDbSourceConfigEntity getConfValue(Integer dbId, String enName) {
        TbDbSourceConfigEntity dbSourceConfigEntity = this.baseMapper.getConfValue(dbId, enName);
        return dbSourceConfigEntity;
    }

}